import request from "../axios";

const api = {

    //添加购物车商品
    cart_add(data) {
        return request({
            url: "/trade/inner-mall/cart/add",
            method: "POST",
            data: data,
            noLoading: true
        });
    },
    //更新购物车商品数量
    cart_update_count(data) {
        return request({
            url: "/trade/inner-mall/cart/update-count",
            method: "PUT",
            data: data,
            noLoading: true
        });
    },
    //更新购物车商品选中
    cart_update_selected(data) {
        return request({
            url: "/trade/inner-mall/cart/update-selected",
            method: "PUT",
            data: data,
        });
    },
    //查询用户的购物车列表
    cart_list(params) {
        return request({
            url: "/trade/inner-mall/cart/list",
            method: "GET",
            params: params,
        });
    },
    //删除购物车商品
    cart_deletet(params) {
        return request({
            url: "/trade/inner-mall/cart/delete",
            method: "DELETE",
            params: params,
        });
    },
};

export default api;
